The Transmission Control Protocol (Transmission Control Protocol, TCP) is a communications protocol specifically designed for providing a reliable end-to-end communications service on the unreliable Internet. When a packet is transmitted based on the TCP protocol, generally, an action of sending the packet by a transmit end is triggered by a TCP acknowledgment (Acknowledgment, ACK) frame that is received from a receive end, and if the ACK frame sent from the receive end is not received, the packet generally is not sent (except for a case of retransmission upon timeout). For some TCP-based applications, such as File Transfer Protocol (File Transfer Protocol, FTP) downloading, if an ACK frame that is sent by a client to a server end is blocked in a network transmission process, latency by which the ACK frame arrives at the server end increases, and a time by which the server end waits to start a next packet transmission increases accordingly; as a result, FTP downloading efficiency decreases. Reasons for ACK frame transmit latency generated inside the transmit end are analyzed below.
In a common network device, an ACK frame and a packet including normal service data are both sent to a link by a same transmission path of a first input first output (First Input First Output, FIFO) structure. It can be known from FIG. 1 that, a transmission path (Tx_path) mainly includes a frame descriptor first input first output (FD_FIFO) unit, a transmit processing (Tx_Pres) unit, a transmit buffer (TxBuffer) unit, and the like. An upper-level traffic management (Traffic Management, TM) module schedules and outputs a frame descriptor (Frame Descriptor, FD) to the transmission path, where the FD records information such as a buffer address and a frame length of a frame. Scheduling of the TM has certain burst and latency. In order to absorb the burst and latency, and adapt to processing of the Tx_Pres unit, FD_FIFO is designed to store the FD. The Tx_Pres reads corresponding packet data from a packet buffer (Packet Buffer) according to buffer address information of the frame that is recorded in the FD. The packet buffer is a memory, and may specifically be a shared random access memory (Random Access Memory, RAM). The packet data read from the packet buffer is first buffered in the TxBuffer. Transmission is started only when there is an entire frame in the TxBuffer or a volume of buffered data reaches a set byte transmit threshold, which can avoid long packet cutoff.
It can be known from the foregoing structure analysis of the transmission path that, the FD_FIFO buffers the FD, the TxBuffer buffers the packet, and the buffered data constitutes a queue head of an FD that newly enters the transmission path. A packet corresponding to the FD that newly enters the transmission path can be sent only after all packets in the queue head have been sent. As shown in FIG. 1, a packet a represents the FD that newly enters the transmission path. There are several packets d that wait to be sent before a, and the packet a is an ACK frame with a high priority. If there are many long packets among the packets d ranked before the packet a, although it can be ensured, by means of strict priority scheduling in the TM, that the TM first schedules the ACK frame with a high priority to enter the transmission path in a case in which there is no backpressure signal, there are multiple long packets that wait to be sent before the ACK frame, very large blocking latency is generated for the ACK frame; if there are many short packets among the packets ranked before the packet a, blocking latency is relatively small. In addition, because a quantity of packets that can be buffered in the transmission path is limited, when the FD_FIFO in the transmission path is filled with packets, the TM receives a backpressure signal of the transmission path and cannot schedule data to enter the transmission path until the transmission path completes sending of a packet to the link and cancels the backpressure signal for the TM. In this case, the blocking latency for the ACK frame becomes larger.
Based on the foregoing analysis, it can be known that because there may be many long packets buffered in the transmission path, that is, a volume of data stored in the transmission path may be very large, all packets including the ACK frame may be subject to large blocking latency in the transmission path. However, in the prior art, a solution that can effectively control the volume of the data stored in the transmission path to control the blocking latency for the packets in the transmission path has not been put forward.